﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWDataDB.BLL;

public partial class UserControl_ZKQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    private void GetContent(string Title)
    {
        ZLInfoQuery zlquery = new ZLInfoQuery();
        string strTitle = this.TITLE.Text;
        string strFileID = Request.Form["FILE_ID"];
        string strKeyWord = Request.Form["KEY_WORDS"];
        string strUnit = Request.Form["UNIT"];
        string strType = Request.Form["DATA_CLASS"];
        string strWorkLevel = Request.Form["WORK_LEVEL"];
        string strMine = Request.Form["MineType"];
        string strRegion = Request.Form["XZArea"];
        string start = Request.Form["START_DATE"];
        string end = Request.Form["END_DATE"];

        //dl_FileList.DataSource = zlquery.ZLInfoAdvanceQueryKC(strTitle, strFileID, strKeyWord, strUnit, strType, strWorkLevel, strMine, strRegion, start, end);
        //dl_FileList.DataBind();
        DataSet ds = zlquery.ZLInfoAdvanceQueryKC(strTitle, strFileID, strKeyWord, strUnit, strType, strWorkLevel, strMine, strRegion, start, end);
        DataTable dt = ds.Tables[0];
        DataView dv = dt.DefaultView;
        //对用于分页的类的引用
        PagedDataSource pds = new PagedDataSource();
        pds.DataSource = dt.DefaultView;//设置数据源(DataTable类型)
        pds.AllowPaging = true;


        AspNetPager1.RecordCount = dv.Count;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        pds.PageSize = AspNetPager1.PageSize;
        dl_FileList.DataSource = pds;
        dl_FileList.DataBind();
    }
    protected void SearchBtn_Click(object sender, ImageClickEventArgs e)
    {
        GetContent("");
        FileList.Attributes["style"] = "display:''";

    }


    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        GetContent("");
    }
}
